﻿using System;
using System.Xml.Serialization;
using DC2010.Objects.Base;

namespace DC2010.Objects.Data
{
    [Serializable]
    public class EventInfo : BaseInfo
    {
        /// <summary>
        /// What method will be used to execute this info.
        /// </summary>
        [XmlAttribute]
        public string Method { get; set; }

        public EventData CreateData()
        {
            EventData ed = new EventData();

            ed.InfoId = Id;
            ed.Id = ed.InfoId + "_" + Guid.NewGuid().ToString();
            Root.log.InfoFormat("Core, Created new object with id: {0} based on object {1}", ed.Id, ed.InfoId);
            //TODO: fill with other properties
            //TODO: parameters!);
            Root.I.EventSystem.AddData(ed);


            return ed;
        }
    }
}
